
/**
 * 实例化mock对象
 */
const Index = require("mockjs")


/**
 * 模拟后端json数据格式
 */
let R = {
    code: '200',
    mgs: '操作成功',
    data: null
}

/**
 * 模拟数据，菜单
 */
Index.mock('/index','get',()=>{
    R.data={
        mgs: '张诚诚'
    }
    return R
})


/**
 * 模拟动态路由
 */

Index.mock('nav/getMenu','get',()=>{
    R.data={
        menuList: [

            {
                path: 'shop-product',
                name: 'shop-product',
                title: '商品管理',
                icon: 'el-icon-goods',
                children: [
                    {
                        path: '/category',
                        name: 'category',
                        icon: 'el-icon-s-operation',
                        title: '三级分类',
                        url: 'product/category'
                    }
                ]
            },
            {
                path: 'member',
                name: 'member',
                title: '会员管理',
                icon: 'el-icon-user',
                children: [
                    {
                        path: '/memberData',
                        name: 'memberData',
                        icon: 'el-icon-pie-chart',
                        title: '会员数据分析',
                        url: 'member/dataAnalyze'
                    }
                ]
            },
            {
                path: 'coupon',
                name: 'coupon',
                title: '优惠营销',
                icon: 'el-icon-money',
                children: [
                    {
                        path: '/coupon/manage',
                        name: 'coupon/manage',
                        icon: 'el-icon-postcard',
                        title: '优惠券管理',
                        url: 'coupon/manage'
                    }
                ]
            },
            {
                path: '/ware',
                name: 'ware',
                title: '库存系统',
                icon: 'el-icon-s-home',
                children: [
                    {
                        path: '/coupon/manage',
                        name: 'coupon/manage',
                        icon: 'el-icon-postcard',
                        title: '优惠券管理',
                        url: 'coupon/manage'
                    }
                ]
            },
            {
                path: '/order',
                name: 'ware',
                title: '订单系统',
                icon: 'el-icon-document',
                children: [
                    {
                        path: '/coupon/manage',
                        name: 'coupon/manage',
                        icon: 'el-icon-postcard',
                        title: '优惠券管理',
                        url: 'coupon/manage'
                    }
                ]
            },
            {
                path: '/order',
                name: 'ware',
                title: '内容管理',
                icon: 'el-icon-bangzhu',
                children: [
                    {
                        path: '/coupon/manage',
                        name: 'coupon/manage',
                        icon: 'el-icon-postcard',
                        title: '优惠券管理',
                        url: 'coupon/manage'
                    }
                ]
            }


        ]
    }
    return R
})
/**
 * 模拟登录
 * 后台返回token,menu,captcha
 */

